package com.talent.service.iot.mqtt.model.response;

import com.talent.service.iot.mqtt.model.fix.TlMqttFixedHead;
import com.talent.service.iot.mqtt.model.variable.TlMqttPubAckVariableHead;
import io.netty.handler.codec.mqtt.MqttMessageType;

/**
 * @ClassName：TlMqttPubAckRes
 * @Author: hszhou
 * @Date: 2024/11/26 15:07
 * @Description: 必须描述类做什么事情, 实现什么功能
 */
public class TlMqttPubAck  {

    private TlMqttFixedHead fixedHead;

    private TlMqttPubAckVariableHead variableHead;

    public TlMqttFixedHead getFixedHead() {
        return fixedHead;
    }

    public void setFixedHead(TlMqttFixedHead fixedHead) {
        this.fixedHead = fixedHead;
    }

    public TlMqttPubAckVariableHead getVariableHead() {
        return variableHead;
    }

    public void setVariableHead(TlMqttPubAckVariableHead variableHead) {
        this.variableHead = variableHead;
    }


    public TlMqttPubAck(TlMqttFixedHead fixedHead, TlMqttPubAckVariableHead variableHead) {
        this.fixedHead = fixedHead;
        this.variableHead = variableHead;
    }

    public static TlMqttPubAck of(int messageId){
        TlMqttFixedHead fixedHead =TlMqttFixedHead.of(MqttMessageType.PUBACK);
        TlMqttPubAckVariableHead tlMqttPubAckVariableHead = TlMqttPubAckVariableHead.of(messageId);
        TlMqttPubAck res = new TlMqttPubAck(fixedHead,tlMqttPubAckVariableHead);
        return res;
    }
}
